//import Users;
import java.util.Date;
import java.util.Iterator;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

import dao.Users;

public class Hello 
{
	public static void main(String[] args) 
	{
		SessionFactory sessionfactory=new Configuration().configure().buildSessionFactory();
		Session session=sessionfactory.openSession();
		 Transaction tx = null;
        //Session session=SessionFactoryUtil.getSessionFactory().getCurrentSession();
        tx=session.beginTransaction();
        Query qur= session.createQuery("from Users ");
    Iterator it=qur.list().iterator();
    while(it.hasNext())
{
	 Users hib=(Users)it.next();
             System.out.println(hib.getCity() +"name is "+ hib.getEmail());
}
        tx.commit();

	}
}
